//
//  PresentationViewController.swift
//  Swift-Tools
//
//  Created by gree on 2020/10/23.
//

import UIKit

class PresentationViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    @IBAction func bottomAction(_ sender: Any) {
        let nextVC = NextController()
        let manager = CTSlideInPresentationManager()
        nextVC.modalPresentationStyle = .custom
        nextVC.transitioningDelegate = manager
        self.present(nextVC, animated: true, completion: nil)
    }
    @IBAction func topAcion(_ sender: Any) {
        let nextVC = NextController()
        let manager = CTSlideInPresentationManager()
        manager.direction = .top()
        nextVC.modalPresentationStyle = .custom
        nextVC.transitioningDelegate = manager
        self.present(nextVC, animated: true, completion: nil)
    }
    
    @IBAction func rightAction(_ sender: Any) {
        let nextVC = NextController()
        let manager = CTSlideInPresentationManager()
        manager.direction = .right()
        nextVC.modalPresentationStyle = .custom
        nextVC.transitioningDelegate = manager
        self.present(nextVC, animated: true, completion: nil)
    }
    
    @IBAction func leftAction(_ sender: Any) {
        let nextVC = NextController()
        let manager = CTSlideInPresentationManager()
        manager.direction = .left()
        nextVC.modalPresentationStyle = .custom
        nextVC.modalTransitionStyle = .coverVertical
        nextVC.transitioningDelegate = manager
        self.present(nextVC, animated: true, completion: nil)
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
